package org.ne.springboot.validation;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import org.ne.springboot.anno.State;

/**
 * @author wey
 * @Date 2025/1/10 下午3:56 1月
 */
public class StateValidation implements ConstraintValidator<State, String> {

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {

        if (s == null) {
            return false;
        }

        return "已发布".equals(s) || "草稿".equals(s);
    }
}
